<?php

namespace Admin\Controller;

use Think\Controller;

class BaseController extends Controller {

    public function __construct() {
        parent::__construct();
        $action = __ACTION__;
       // echo $action;exit;
        $noLogin = [
            '/index.php/Admin/User/login',
        ];
        $user = session('user');
        if (!in_array($action, $noLogin)) {
            if (empty($user)) {
                $this->redirect('Admin/User/login');
            }
        }
    }

}
